"""
根路由
"""

from fastapi import (
    APIRouter,
    FastAPI,
)

from api import (
    admin_module_router,
    common_module_router,
    family_module_router,
    health_module_router,
    user_module_router,
)

api_version_router: APIRouter = APIRouter(prefix="/api/v1")
""" 接口版本 | 路由 """

for _ in (
    admin_module_router,
    common_module_router,
    family_module_router,
    user_module_router,
):
    api_version_router.include_router(_)

root_router: APIRouter = APIRouter()
""" 根路由 """

# 在根路由下分配子路由
root_router.include_router(api_version_router)
root_router.include_router(health_module_router)


def register_router(app: FastAPI) -> None:
    """ 注册路由 """

    app.include_router(root_router)
